package deployr.core;

import java.io.*;

public class Read {

	private static InputStream fromClasspath(String classpath) {
		try {
			return Read.class.getClassLoader().getResourceAsStream(classpath);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public static InputStream read(String protocolAndPath) {
		String protocol = protocolAndPath.replaceAll(":.*$", "");
		String path = protocolAndPath.replaceAll("^.*:", "");
		return fromClasspath(path);
	}

}
